source comm.cfg

ssh ${MASTER1} "if [ ! -d '${INSTALLDIR}' ]; then mkdir -p '${INSTALLDIR}'; fi"
ssh ${MASTER2} "if [ ! -d '${INSTALLDIR}' ]; then mkdir -p '${INSTALLDIR}'; fi"

scp check_mysql.sh master2-my.cnf comm.cfg ${MASTER2}:${INSTALLDIR}
scp check_mysql.sh master1-my.cnf comm.cfg ${MASTER1}:${INSTALLDIR}

nohup ssh ${MASTER1} "cd ${INSTALLDIR} && bash -s" < install.sh > ${MASTER1}-mysql.log 2>&1 &
nohup ssh ${MASTER2} "cd ${INSTALLDIR} && bash -s" < install.sh > ${MASTER2}-mysql.log 2>&1 &
